﻿
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>壁纸大全</title>


<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="shortcut icon"
	href="${pageContext.request.contextPath}/favicon.ico">
<!-- Animate.css -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/animate.css">
<!-- Icomoon Icon Fonts-->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/icomoon.css">
<!-- Bootstrap  -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/bootstrap.css">

<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/style.css">

<!-- jQuery -->
<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<!-- jQuery Easing -->
<script src="${pageContext.request.contextPath}/js/jquery.easing.1.3.js"></script>
<!-- Bootstrap -->
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<!-- Waypoints -->
<script
	src="${pageContext.request.contextPath}/js/jquery.waypoints.min.js"></script>

<!-- Main JS (Do not remove) -->
<script src="${pageContext.request.contextPath}/js/main.js"></script>


<!-- Modernizr JS -->
<script
	src="${pageContext.request.contextPath}/js/modernizr-2.6.2.min.js"></script>
<!-- FOR IE9 below -->
<!--[if lt IE 9]>
	<script src="../js/respond.min.js"></script>
	<![endif]-->
<style type="text/css">
.logo {
	width: 50px;
	height: 50px;
}
</style>
</head>
<body>


	<script>
		$(function() {
			t(1);
		});
		function t(page) {

			$
					.ajax({
						url : "${pageContext.request.contextPath}/system/news/getAllNews",
						data : {
							"page" : page
						},
						type : "GET",
						dataType : "json",
						success : function(data) {
							$("#c").empty();
							for ( var i = 0; i < data.datas.length; i++) {

								var c = '<div class="col-md-6"><div class="fh5co-grid animate-box fadeInUp animated"  id="ss'
										+ i
										+ '" style="background-image: url(${pageContext.request.contextPath}/'
										+ data.datas[i].urlpicture
										+ ');"><a class="image-popup text-center" href="#"><div class="work-title"><h3>'
										+ data.datas[i].title
										+ '</h3><span>'
										+ data.datas[i].content
										+ '</span></div></a></div></div>';

								$("#c").append(c);

							}

							// var next='<a href="${pageContext.request.contextPath}/news/getAllNews?page='+data.pageCount+'">'+"下一页"+'</a>';

							//	for(var j=0;j<data.datas.length;j++){

							//		$("#ss"+j+"").css("background-image","url(../"+data.datas[j].urlpicture+")");

							//	}

							var next = '<a href="javascript:t('
									+ data.nextPage
									+ ')"><span class="glyphicon glyphicon-chevron-down"></span></a>';
							$("#next").empty();
							$("#next").append(next);
							if (data.currPage >= data.pageCount) {
								$("#next").empty();
							}
							var prev = '<a href="javascript:t('
									+ data.prevPage
									+ ')"><span class="glyphicon glyphicon-chevron-up"></span></a>';
							$("#prev").empty();
							$("#prev").append(prev);
							if (data.currPage <= 1) {
								$("#prev").empty();
							}
						},
						error : function() {
							alert("error");
						}
					});
		}
	</script>


	<div class="box-wrap">
		<header role="banner" id="fh5co-header">
			<div class="container">
				<nav class="navbar navbar-default">
					<div class="row">
						<div class="col-md-3">
							<div class="fh5co-navbar-brand">
								<a class="fh5co-logo"
									href="${pageContext.request.contextPath}/html/index.html">
									<img class="logo"
									src="${pageContext.request.contextPath}/images/logo.png"
									title="壁纸之家">
								</a>
							</div>
						</div>
						<div class="col-md-6">
							<ul class="nav text-center">
								<li class="active"><a
									href="${pageContext.request.contextPath}/system/news/toindex"><span>壁纸大全</span>
								</a>
								</li>
								<li><a
									href="${pageContext.request.contextPath}/system/news/toaddnews">壁纸添加</a>
								</li>
								<li><a
									href="${pageContext.request.contextPath}/system/news/toservice">壁纸分类</a>
								</li>
								<li><a
									href="${pageContext.request.contextPath}/system/news/tomynews">我的壁纸</a>
								</li>
							</ul>
						</div>
						<div class="col-md-3">
							<div class="fh5co-navbar-brand">
								<a href="${pageContext.request.contextPath}/system/user/tologin"
									title="登录"> LOGIN</a>
							</div>
						</div>
					</div>
				</nav>
			</div>
		</header>
		<!-- END: header -->
		<section id="intro">
			<div class="container">
				<div class="row">
					<div
						class="col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 text-center">
						<div class="intro animate-box">
							<h2>更 多 精 美 壁 纸 尽 在 壁 纸 之 家</h2>
						</div>
					</div>
				</div>
			</div>
		</section>
		<section id="work">
			<div class="container">
				<div class="col-md-12">
					<div class="animate-box">
						<a class="text-center" href="#">
							<div class="work-title">
								<h3 id="prev"></h3>
							</div> </a>
					</div>
				</div>

				<div class="row" id="c"></div>

				<div class="col-md-12">
					<div class="animate-box">
						<a class="text-center" href="#">
							<div class="work-title">
								<h3 id="next"></h3>
							</div> </a>
					</div>
				</div>
			</div>
		</section>


		<footer id="footer" role="contentinfo">
			<div class="container">
				<div class="row">
					<div class="col-md-12 text-center ">
						<div class="footer-widget border">
							<p class="pull-left">
								<small>&copy;The home of the wallpaper</small>
							</p>
							<p class="pull-right">
								<small> Designed by <a href="#">WSG</a> The home of the
									wallpaper <a href="#" target="_blank">壁纸之家</a> - Worth having</small>
							</p>

						</div>
					</div>
				</div>
			</div>
		</footer>
	</div>
	<!-- END: box-wrap -->

</body>
</html>

